package com.example.bes.dubbo.consumer.demo.controller;

import com.example.bes.dubbo.api.demo.service.IMessageService;
import com.example.bes.dubbo.api.demo.vo.Message;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/consumer/message")
public class MessageController {

    @DubboReference
    private IMessageService messageService;

    @RequestMapping(value = "/msg")
    public Object echo(@RequestBody Message msg) {
        return this.messageService.echo(msg);
    }
}
